<template>
	<view class="content">
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<view class="bgRed flex-r ver-c p16" slot="top">
				<!-- <u-search placeholder="搜索商品" :showAction="false" @click="toSearch()" disabled="true"></u-search> -->
				<input
					type="text"
					placeholder="请输入关键字进行搜索"
					v-model="keyword"
					class="f1"
					style="background: #fff; border-radius: 50rpx; font-size: 28rpx; padding: 13rpx; text-align: center"
				/>
				<text @click="searchs()" class="white pl16">搜索</text>
			</view>
			<shopLists :list="dataList"></shopLists>
		</z-paging>
	</view>
</template>

<script>
import { ImgIP } from '@/utils/comm.js'
import { getMerchantList } from '@/api/index.js'
import shopLists from '@/pages_C/components/shop-list/shop-lists.vue'
export default {
	components: {
		shopLists
	},
	data() {
		return {
			keyword: '',
			tMerchantid: '',
			deptId: '',
			dataList: []
		}
	},
	onLoad(option) {
		if (option.keyword) {
			this.keyword = option.keyword
		}
	},
	methods: {
		searchs() {
			this.$refs.paging.reload()
		},
		queryList(pageNo, pageSize) {
			//组件加载时会自动触发此方法，因此默认页面加载时会自动触发，无需手动调用
			//这里的pageNo和pageSize会自动计算好，直接传给服务器即可

			getMerchantList(pageNo, pageSize, this.keyword).then(
				(res) => {
					console.log('111-->', res)
					this.$refs.paging.complete(res.rows)
				},
				(err) => {
					this.$refs.paging.complete(false)
				}
			)
		},
		getGood() {}
	}
}
</script>

<style scoped lang="stylus">
.content
	min-height 100%
</style>